package cn.com.dhcc.turbo.service.monitor;

import cn.com.dhcc.turbo.service.monitor.handler.EmailHandler;
import cn.com.dhcc.turbo.service.monitor.handler.QuotaOntimeValueHandler;


/**
 * 监控用枚举
 * @author qiao
 * @2014-6-3 @下午5:43:13
 */
public class MonitorQuotaStatic{
	    
	    /**
	     * 指标类型
	     */
	    public static enum QUOTA_TYPE {
			NODE("1","节点监控"),
			PIPELINE("2","通道监控"),
			FLOW("3","发送接收请求流量监控"),
			STRUCTURED("4","结构化数据监控"),
			UNSTRUCTURED("5","非结构化数据监控");
			private String code;
			private String name;
			private QUOTA_TYPE(String code,String name){
				this.name = name;
			}
			public String getName() {
				return name;
			}
			public String getCode() {
				return code;
			}
	    }
	    /**
	     * 告警级别
	     */
	    public static enum  ALTER_LEVEL{
	    	LOW("1","低"),
	    	MID("2","中"),
	    	HIG("3","高");
	    	private String code;
			private String name;
			private ALTER_LEVEL(String code,String name){
				this.code  = code;
				this.name = name;
			}
			public String getName() {
				return name;
			}
			public String getCode() {
				return code;
			}
	    }
	    /**
	     * 告警处理方式
	     * @author qiao
	     * @2014-6-4 @下午2:11:44
	     */
	    public static enum ALERT_PIPELINE{
	    	EMAIL("1","邮件通知",EmailHandler.class),
	    	VOICE("2","告警音"),
	    	AUTO_CLOSE("80","系统自动关闭"),
	    	ADMIN_CLOSE("81","管理员手动关闭");
	    	private String code;
			private String name;
			private Class<? extends QuotaOntimeValueHandler> ontimeValueHandler; 
			private ALERT_PIPELINE(String code,String name){
				this.name = name;
				this.code = code;
			}
			private ALERT_PIPELINE(String code,String name,Class<? extends QuotaOntimeValueHandler> ontimeValueHandler){
				this.name = name;
				this.code = code;
				this.ontimeValueHandler = ontimeValueHandler;
			}
			public String getName() {
				return name;
			}
			public String getCode() {
				return code;
			}
			public Class<? extends QuotaOntimeValueHandler> getOntimeValueHandler() {
				return ontimeValueHandler;
			}
			
	    }
	    /**
	     * 指标归属
	     * @author qiao
	     * @2014-6-4 @下午2:11:44
	     */
	    public static enum QUOTA_OWNER{
	    	NODE("1","节点"),
	    	DOMAIN("2","业务域"),
	    	ADAPTER("3","适配器");
	    	private String code;
			private String name;
			private QUOTA_OWNER(String code,String name){
				this.name = name;
				this.code = code;
			}
			public String getName() {
				return name;
			}
			public String getCode() {
				return code;
			}
	    }
	    /**
	     * 取值类型
	     */
	    public static enum  VALUE_TYPE{
	    	NUMBER("1"),//数字
	    	STRING("2");//字符串
	    	private String code;
			private VALUE_TYPE(String code){
				this.code = code;
			}
			public String getCode() {
				return code;
			}
	    } 
	    /**
	     * 系统默认的占位符
	     * @author qiao
	     * @2014-6-4 @下午3:25:16
	     */
	    public static enum PLACEHOLDER{
	    	NODE_NAME("${nodename}","节点名称from占位符"),
	    	NODE_NAME_FROM("${nodename_from}","节点名称from占位符"),
	    	NODE_NAME_TO("${nodename_to}","节点名称to占位符"),
	    	ADAPTER_NAME("${adaptername}","系统名称from占位符"),
	    	ADAPTER_NAME_FROM("${adaptername_from}","系统名称from占位符"),
	    	ADAPTER_NAME_TO("${adaptername_to}","系统名称to占位符"),
	    	CURRENT_VALUE_1("${v1}","实时值1"),
	    	CURRENT_VALUE_2("${v2}","实时值2"),
	    	CONF_VALUE_1("${f1}","用户配置值1"),
	    	CONF_VALUE_2("${f2}","用户配置值2");
	    	private String code;
			private String name;
//			private String key;
			private PLACEHOLDER(String code,String name){
				this.name = name;
				this.code = code;
			}

			public String getName() {
				return name;
			}
			public String getCode() {
				return code;
			}
			
			public String getKey(){
				return code.substring(2,code.length()-1);
			}
			
	    }
}
